home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / The World of Computer Software.iso / wfs203.zip / WFSAUTH.C < prev    next >
C/C++ Source or Header  |  1992-11-15  |  1KB  |  49 lines

  1. /* -----------------------------------------------------------------------
  2.    wfsauth.c -- WFS sample authorization exit
  3.  
  4.    wfsauth interprets argv[1] as the requestor's address.
  5.  
  6.    Yes, the example is simplistic.
  7.  
  8.    Returns:
  9.       0 -- permit processing of the request
  10.       1 -- Abandon this message. Do not send a session transcript to
  11.            the requestor.
  12.  
  13.    Compile with Microsoft C6 or C7
  14.  
  15.  
  16. Copyright 1992, The Birdsong Company, Sunnyvale CA USA -- All Rights Reserved
  17. -------------- */
  18.  
  19. #include <string.h>
  20.  
  21. // --- define return values for the User authorization exit
  22. //
  23. #define AUTHORIZED    0
  24. #define NOTAUTHORIZED 1
  25.  
  26.  
  27. /* ---------------------------------------------------------------------
  28.    main() -- The main function
  29.  
  30. ---------- */
  31. int main( int argc, char **argv ) {
  32.    char * user = *(argv +1); // Pointer to requestor
  33.  
  34.  
  35.    // -----------------------------------------
  36.    // check the user against something ---
  37.    // if there is some address like this, lock him out!
  38.  
  39.    if ( stricmp( user, "frobaz@dinkle.dork.gazorchkas.com" ) == 0 ) 
  40.       return NOTAUTHORIZED;
  41.  
  42.    // ----------------------------------------
  43.    // return AUTHORIZED to permit processing
  44.    
  45.    return AUTHORIZED;
  46.  
  47. } // --- end main() ---
  48.  
  49.